package com.danbay.framework.exception;

import lombok.Data;

/**
 * 消息码异常包装
 * @author sjg
 *
 */
@Data
public class MessageCodeException extends Exception {


	private String msg;
	
	private Integer code;
	
	private Object data;
	
	/**
	 * 是否为业务异常
	 */
	private boolean business;
	
	public boolean isBusiness() {
		return business;
	}

	public void setBusiness(boolean business) {
		this.business = business;
	}

	public MessageCodeException(){
		
	}
	
	public MessageCodeException(String msg,Integer code){
		super(msg+":"+code);
		this.msg=msg;
		this.code=code;
	}
	
	public MessageCodeException(String msg,Integer code,Throwable ex){
		super(msg,ex);
		this.msg=msg;
		this.code=code;
	}
	
	public MessageCodeException(String msg,Integer code,boolean business,Throwable ex){
		super(msg,ex);
		this.msg=msg;
		this.code=code;
		this.business=business;
	}

}
